package com.wxhandle.cleandemo.core.services;

public interface EditableServcie<T, TKey> extends QueryableService<T, TKey> {
    /// <summary>
    /// 插入新实例到数据表
    /// </summary>
    /// <param name="entity">新实例</param>
    /// <returns>数据中实例</returns>
    T insert(T entity);


    /// <summary>
    /// 更新实例
    /// </summary>
    /// <param name="entity">待更新实例</param>
    T update(T entity);


    /// <summary>
    /// 删除实例
    /// </summary>
    /// <param name="entity">待删除实例</param>
    void delete(T entity);

    /// <summary>
    /// 删除实例
    /// </summary>
    /// <param name="val">待删除实例主键</param>
    void deleteById(TKey val);
}
